package dados;
import negocios.Operacoes;

public class BancoOperacoes implements IBancoOperacoes{
	
	private static BancoOperacoes instancia = null;
	
	public static BancoOperacoes getInstancia() {

		if (instancia == null) 
		{ instancia = new BancoOperacoes();}
	
		return instancia;
		
	}
	   public void incluirOperacao(Operacoes operacao){		
			try {
				 ConectaBDOperacoes conexao = new ConectaBDOperacoes();
		 		 conexao.incluirOperacao(operacao);
	 		     }
			catch(Exception e){
	 			e.printStackTrace();}		
		}
	   
	   public void editarOperacao(Operacoes operacao){		
			try {
				 ConectaBDOperacoes conexao = new ConectaBDOperacoes();
		 		 conexao.editarOperacao(operacao);
	 		     }
			catch(Exception e){
	 			e.printStackTrace();}		
		}
	   
	   public Operacoes[] listarOperacao(Operacoes operacao, String op){		
			try {
				 ConectaBDOperacoes conexao = new ConectaBDOperacoes();
		 		 return conexao.listarOperacoes(operacao, op);
	 		     }
			catch(Exception e){
	 			e.printStackTrace();return null;}		
		}
	   
	   public Operacoes consultarOperacao(Operacoes operacao,boolean flag){		
			try {
				 ConectaBDOperacoes conexao = new ConectaBDOperacoes();
		 		 return conexao.consultarOperacao(operacao ,flag);
	 		     }
			catch(Exception e){
	 			e.printStackTrace();
	 			return null;}		
		}
	   
	   public void excluirOperacao(int cod) {
			try {
				 ConectaBDOperacoes conexao = new ConectaBDOperacoes();
		 		 conexao.excluirOperacao(cod);
			     }
			catch(Exception e){
				e.printStackTrace();}	
			
		}


	
	

}
